package com.itheima.demo04;

import java.util.Objects;

public class MainClass {
    public static void main(String[] args) {
        Student student1 = new Student("张三", 23);
        System.out.println(student1);

        Student student2 = new Student("张三", 23);
        System.out.println(Objects.toString(student2,"我是一个好孩子"));

        Student student3 = null;
        System.out.println(Objects.toString(student3,"我是一个好孩子"));

        boolean result1 = Objects.isNull(student3);
        System.out.println(result1);
        boolean result2 = Objects.isNull(student2);
        System.out.println(result2);
        boolean result3 =  Objects.nonNull(student3);
        System.out.println(result3);
        boolean result4 = Objects.nonNull(student2);
        System.out.println(result4);
    }
}
